package com.muyu.danmo.service.impl;


import com.muyu.common.core.utils.DateUtils;
import com.muyu.danmo.domain.DanmoTrainingShoppingProductsPicture;
import com.muyu.danmo.mapper.DanmoTrainingShoppingProductsPictureMapper;
import com.muyu.danmo.service.IDanmoTrainingShoppingProductsPictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 培训班商品图片Service业务层处理
 * 
 * @author kunzong
 * @date 2024-11-28
 */
@Service
public class DanmoTrainingShoppingProductsPictureServiceImpl implements IDanmoTrainingShoppingProductsPictureService
{
    @Autowired
    private DanmoTrainingShoppingProductsPictureMapper danmoTrainingShoppingProductsPictureMapper;

    /**
     * 查询培训班商品图片
     * 
     * @param id 培训班商品图片主键
     * @return 培训班商品图片
     */
    @Override
    public DanmoTrainingShoppingProductsPicture selectDanmoTrainingShoppingProductsPictureById(Long id)
    {
        return danmoTrainingShoppingProductsPictureMapper.selectDanmoTrainingShoppingProductsPictureById(id);
    }

    /**
     * 查询培训班商品图片列表
     * 
     * @param danmoTrainingShoppingProductsPicture 培训班商品图片
     * @return 培训班商品图片
     */
    @Override
    public List<DanmoTrainingShoppingProductsPicture> selectDanmoTrainingShoppingProductsPictureList(DanmoTrainingShoppingProductsPicture danmoTrainingShoppingProductsPicture)
    {
        return danmoTrainingShoppingProductsPictureMapper.selectDanmoTrainingShoppingProductsPictureList(danmoTrainingShoppingProductsPicture);
    }

    /**
     * 新增培训班商品图片
     * 
     * @param danmoTrainingShoppingProductsPicture 培训班商品图片
     * @return 结果
     */
    @Override
    public int insertDanmoTrainingShoppingProductsPicture(DanmoTrainingShoppingProductsPicture danmoTrainingShoppingProductsPicture)
    {
        danmoTrainingShoppingProductsPicture.setCreateTime(DateUtils.getNowDate());
        return danmoTrainingShoppingProductsPictureMapper.insertDanmoTrainingShoppingProductsPicture(danmoTrainingShoppingProductsPicture);
    }

    /**
     * 修改培训班商品图片
     * 
     * @param danmoTrainingShoppingProductsPicture 培训班商品图片
     * @return 结果
     */
    @Override
    public int updateDanmoTrainingShoppingProductsPicture(DanmoTrainingShoppingProductsPicture danmoTrainingShoppingProductsPicture)
    {
        danmoTrainingShoppingProductsPicture.setUpdateTime(DateUtils.getNowDate());
        return danmoTrainingShoppingProductsPictureMapper.updateDanmoTrainingShoppingProductsPicture(danmoTrainingShoppingProductsPicture);
    }

    /**
     * 批量删除培训班商品图片
     * 
     * @param ids 需要删除的培训班商品图片主键
     * @return 结果
     */
    @Override
    public int deleteDanmoTrainingShoppingProductsPictureByIds(Long[] ids)
    {
        return danmoTrainingShoppingProductsPictureMapper.deleteDanmoTrainingShoppingProductsPictureByIds(ids);
    }

    /**
     * 删除培训班商品图片信息
     * 
     * @param id 培训班商品图片主键
     * @return 结果
     */
    @Override
    public int deleteDanmoTrainingShoppingProductsPictureById(Long id)
    {
        return danmoTrainingShoppingProductsPictureMapper.deleteDanmoTrainingShoppingProductsPictureById(id);
    }
}
